yum install -y epel-release
yum update -y 

# 设置仓库
yum install -y yum-utils   device-mapper-persistent-data  lvm2
# 使用以下命令来设置稳定的仓库
yum-config-manager   --add-repo   https://download.docker.com/linux/centos/docker-ce.repo

# 安装 Docker Engine-Community,如果提示您接受 GPG 密钥，请选是
yum install -y docker-ce docker-ce-cli containerd.io

# 验证是否安装成功
systemctl start docker
docker run hello-world

# 安装docker-compose
curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
echo -e  "\n\n\nTesting if docker-compose is successfully installed\n"
docker-compose --version
